package com.neutech.shop.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;

/**
 * @author Neuedu-远哥
 * @version 1.0
 * @date 2021/9/27 9:16
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Category implements Serializable {
    private Long id;
    private String name;
    private String descr;
    private Integer pid;
    /**
     * 是否是叶子节点
     */
    private Byte leaf;

    private Integer grade;

    private Timestamp createTime;
    private Timestamp updateTime;
    /**
     * 存放当前类别的直接子类别
     */
    private List<Category> children;

    /**
     * 添加根类别的构造方法
     * @param name 类别名称
     * @param descr 类别描述
     */
    public Category(String name, String descr) {
        this.name = name;
        this.descr = descr;
    }

}
